<template>
	<view>
		<uni-nav-bar statusBar=true color="#000" fixed="true" left-icon="back" title="汇天富双利券A">
		</uni-nav-bar>
		<view class="head">
			<view class="">
				<view class="" style="font-size: 60rpx;margin-top: 40rpx;margin-bottom: 20rpx;">2.48</view>
				<text>七日年华收益率(100%)</text>
			</view>
			<view class="bottom">
				<view class="">
					<view class="" style="font-size: 40rpx;margin-bottom: 10rpx;">0.6709</view>
					<text>万份收益（02-26）</text>
				</view>
				<view class="">
					<view class="" style="font-size: 40rpx;margin-bottom: 10rpx;">100.00</view>
					<text>起购金额</text>
				</view>
			</view>

		</view>
		<view class="title-wraper">
			<view class="title">
				<text class="big-title">七日年化收益曲线</text>
				<uni-icons type="forward" class="forward" color="gray"></uni-icons>
			</view>
		</view>
		<view class="content">
			<view class="charts-box">
				<qiun-data-charts type="line" :chartData="chartData1" background="none" />
			</view>
			<view class="choose"><text class="time active">分时</text><text class="time">近一月</text><text
					class="time">近半年</text><text class="time">近一年</text></view>
		</view>
		<view class="info">
			<view class="info-title">
				<view class="" v-for="item in infoTitle" :key="item.id">
					<view class="active" v-if="activeId==item.id">
						<text>{{item.name}}</text>
						<view class="line"></view>
					</view>
					<view class="item" v-else @tap="activeId=item.id">
						<text>{{item.name}}</text>
					</view>
				</view>
				<!-- <view class="">
					<view class="item" v-if="false">
						<text>交易规则</text>
						<view class=""></view>
					</view>
					<view class="item">
						<text>交易规则</text>
					</view>
				</view>
				<view class="">
					<view class="item" v-if="false">
						<text>常见问题</text>
						<view class=""></view>
					</view>
					<view class="item">
						<text>常见问题</text>
					</view>
				</view> -->
			</view>
			<view class="basic-info" v-show="activeId==1">
				<view class="">
					<text style="font-size: 30rpx;">基本信息</text>
				</view>
				<view class="">
					<text>基金全称 </text>
					<text>汇添富双利债券型证券投资基金</text>
				</view>
				<view class="">
					<text>基金代码 </text>
					<text>470018</text>
				</view>
				<view class="">
					<text>基金类型 </text>
					<text>债券型(低风险)</text>
				</view>
				<view class="">
					<text>基金状态 </text>
					<text>开放交易</text>
				</view>
				<view class="">
					<text>成立时间 </text>
					<text>2011-01-26</text>
				</view>
				<view class="">
					<text>基金经理 </text>
					<text>杨宇宁</text>
					<uni-icons type="forward" class="forward" color="gray"></uni-icons>
				</view>
				<view class="">
					<text>基金公司 </text>
					<text>汇添富基金管理股份有限公司</text>
					<uni-icons type="forward" class="forward" color="gray"></uni-icons>
				</view>
				<view class="assets">
					<view class="title">
						<text class="big-title">资产配置</text>
					</view>
				</view>

				<view class="">
					<view class="charts-box">
						<!-- <qiun-data-charts type="ring" :chartData="chartData2" background="none" /> -->
					</view>
				</view>

			</view>
			<Rules v-show="activeId==2"></Rules>
			<Problem v-show="activeId==3"></Problem>
			<view class="prompt">
				<view class="company">
					基金销售服务由成都宇宁基金销售有限公司提供
				</view>
				<view class="">
					<text>投资前请详细阅读基金合同，招募说明书。基金的过往业绩不预示其未来表现。</text>
				</view>
				<text>市场有风险,投资需谨慎</text>
			</view>
		</view>
		<view class="footer">
			<view class="item">
				<uni-icons type="star" size="30"></uni-icons>
				<text>收藏</text>
			</view>
			<view class="item">
				<uni-icons type="chat" size="30"></uni-icons>
				<text>圈子</text>
			</view>
			<view class="item-btn" style="background-color:rgb(226,188,127) ;">定投</view>
			<view class="item-btn" style="background-color:rgb(52,118,241);">立即购买</view>
		</view>
	</view>
</template>

<script>
	import Rules from "@/components/fund_rules/fund_rules.vue"
	import Problem from '@/components/fund_problem/fund_problem.vue'
	export default {
		components: {
			Rules,
			Problem
		},
		data() {
			return {
				infoTitle: [{
					id: 1,
					name: "基金档案"
				}, {
					id: 2,
					name: "交易规则"
				}, {
					id: 3,
					name: "常见问题"
				}],
				activeId: 1,
				chartData1: {
					"categories": ["01-28", "02-09", "02-26"],
					"series": [{
							"name": "成交量A",
							"data": [
								35,
								8,
								25,
								37,
								4,
								20
							]
						},
						{
							"name": "成交量B",
							"data": [
								70,
								40,
								65,
								100,
								44,
								68
							]
						}
					]
				},
				chartData2: {
					"series": [{
						"data": [{
								"name": "证券",
								"value": 50
							},
							{
								"name": "股票",
								"value": 30
							},
							{
								"name": "现金",
								"value": 20
							}
						]
					}]
				}


			}

		},
		methods: {

		}
	}
</script>

<style lang="scss">
	.head {
		height: 400rpx;
		background-image: url(../../static/fund/details.png);
		color: #fff;
		font-size: 28rpx;
		text-align: center;
		overflow: hidden;

		.bottom {
			display: flex;
			margin-top: 50rpx;
			justify-content: space-around;
		}
	}

	.title-wraper {
		padding: 0 24rpx;
		position: relative;
		top: -40rpx;
		border-radius: 40rpx 40rpx 0 0;
		background-color: white;
		overflow: hidden;
	}

	.title-wraper .title {
		border-left: 10rpx solid #3476f1;
		height: 40rpx;
		padding: 0 10rpx;
		line-height: 40rpx;
		margin: 40rpx 0;

		background-color: white;

		.big-title {
			font-size: 32rpx;
			font-weight: bold;
		}

		.forward {
			vertical-align: middle;
			position: absolute;
			right: 0;

		}

	}

	.content {
		padding: 0 24rpx;
		text-align: center;

		.charts-box {
			width: 700rpx;
			height: 300px;
			background-color: white;
		}

		.choose {
			background-color: white;
		}

		.time {
			display: inline-block;
			width: 160rpx;
			height: 52rpx;
			line-height: 52rpx;
			border: 1rpx solid #f3f3f3;

		}

		.active {
			color: #fff;
			background-color: #3476f1;
		}
	}

	.info {
		padding: 0 24rpx;

		.info-title {
			margin: 10rpx 0;
			height: 100rpx;
			display: flex;
			background-color: white;
		}

		.item {
			width: 200rpx;
			line-height: 100rpx;
			text-align: center;
			font-size: 30rpx;
			color: gray;
		}

		.active {
			color: #3476f1;
			font-size: 35rpx;
			width: 200rpx;
			text-align: center;
			line-height: 80rpx;

		}

		.line {
			width: 50rpx;
			border-radius: 5rpx;
			height: 10rpx;
			background-color: #3476f1;
			margin: 0 auto;
		}

		.basic-info view {
			color: gray;
			background-color: white;
			height: 100rpx;
			line-height: 100rpx;
			padding-left: 20rpx;
			margin-bottom: 5rpx;
			position: relative;

			text {
				margin-right: 20rpx;
			}

			.forward {
				position: absolute;
				right: 10rpx;
			}
		}

		.assets {
			line-height: 100rpx;
			overflow: hidden;
		}

		.assets .title {
			border-left: 10rpx solid #3476f1;
			height: 40rpx;
			padding: 0 10rpx;
			line-height: 40rpx;
			margin-top: 33rpx;
			font-size: 32rpx;
			font-weight: bold;
			color: black;
		}

		.prompt {
			margin-top: 20rpx;
			color: gray;
			font-size: 20rpx;
			margin-bottom: 110rpx;

			.company {
				font-size: 25rpx;
				margin-bottom: 10rpx;
			}
		}
	}

	.footer {
		height: 110rpx;
		display: flex;
		position: fixed;
		background-color: white;
		bottom: 0;

		.item {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-evenly;
			width: 126rpx;
			border-right: 1rpx solid #d0d0d0;
		}

		.item-btn {
			width: 250rpx;
			line-height: 110rpx;
			text-align: center;
			color: white;
			font-size: 30rpx;
		}
	}
</style>
